package com.carlinfo.common.util;

import java.io.InputStream;
import java.util.ResourceBundle;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class ConstantFinalUtil
{
	public static ResourceBundle bundle = ResourceBundle.getBundle("userscenter");
	/*
	 * 全局的配置文件
	 * */
	public static JSONObject CONFIG_JSON = new JSONObject();
	
	public static JSONObject INFO_JSON = new JSONObject();
	
	public static JSONObject CONFIG1_JSON = new JSONObject();
	/**
	 * 静态代码块
	 */
	static 
	{
		IOUtil ioutil = new IOUtil();
		InputStream is = IOUtil.class.getResourceAsStream("/config.json");
		String fileStr = ioutil.readFile(is);
		CONFIG_JSON = (JSONObject) JSON.parse(fileStr);
		INFO_JSON = (JSONObject) CONFIG_JSON.get("info");
		CONFIG1_JSON = (JSONObject) CONFIG_JSON.get("config");
	}
	public static void main(String[] args)
	{
		System.out.println("====");
		ResourceBundle rb = ResourceBundle.getBundle("userscenter");
		String root = rb.getString("jdbc.user");
		System.out.println(root);
	}
}
